﻿
using LightSO.ILibrary;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Xml.Linq;
using System.Xml.Serialization;


namespace LightSO.ILibrary
{
    /// <summary>
    /// 实现ISerializerHelper接口的对象统一由Spring创建
    /// （实现接口需在Web.Config配置Spring容器，指定实例的类型与程序集）
    /// </summary>
    public partial interface ISerializerHelper : InterfaceBase
    {
        T Parse<T>(string value);
        string ToJson(object obj);
        Stream ToStream<T>(T obj);
        Stream ToStream(string text);
        T FromJson<T>(string json);
        T2 ConvertTo<T1, T2>(T1 value);
        XDocument ToXDoc<T>(T obj);
        T FromXDoc<T>(XDocument document);
        T FromXml<T>(string xml);
        T FromXmlFile<T>(string xmlPath);
        T IfNull<T>(T value, T defaultValue);
        object IfNull(object value, object defaultValue);
        TOut IfNull<TInput, TOut>(TInput value, TOut defaultValue, Func<TInput, TOut> converter);
        IDictionary<string, string> ToDictionary(object obj);
    }
}


